"""
作者:张玲
把订单完成的页面设置成一个类
"""
#引入模块
from MY_ECShop.common.base import create_browser,Base

#将商品提交订单页面定义成一个类
class PageFinishOrder(Base):
    #定义属性
    url = ('http://localhost:8080/ecshop/flow.php?step=done')
    order_num = ('xpath','/html/body/div[6]/div/h6/font')
    #定义方法
    #进入订单完成页面
    def page_finish_order_open_web(self):
        self.base_open_web(self.url)

    #获取订单元素的文本
    def page_order_text(self):
        text = self.base_get_text(self.order_num)
        return text

if __name__ == '__main__':
    my_browser = create_browser()
    e2 = PageFinishOrder(my_browser)
    e2.page_finish_order_open_web()
    print(e2.page_order_text())